package section1;

/*
	Sample Input
	4 1 2 3 4
	5 1 2 3 4 5
	0 
	Sample Output
	10
	15
 * */
import java.util.Scanner;
public class PracticeIV {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a,b,n,sum;
		while(sc.hasNext()){
			sum = 0;
			n = sc.nextInt();
			if(n==0||n<0) break;
			for(int i=0; i<n; i++){
				sum = sum + sc.nextInt();
			}
			System.out.println(sum);
		}
	}
}
